<template>
  <div id="app" style="height:100%">
    <Header></Header>
    <router-view class="a-fadein"></router-view>
  </div>
</template>

<script>
import { Notify } from "vant";
import Header from "@/components/Header";
export default {
  name: "app",
  components: {
    Header
  },
  mounted() {
    // 判断网络状态
    //this.isOnLine();
  },
  methods: {
    isOnLine() {
      if (window.navigator.onLine == true) {
        Notify({
          message: "网络已连接成功",
          duration: 1000,
          background: "#04BE02"
        });
      } else {
        Notify("网络状态已断开");
      }
    }
  }
};
window.addEventListener("online", online, false);
window.addEventListener("offline", offline, false);
function online() {
  Notify({
    message: "网络已重新连接",
    duration: 1000,
    background: "#1989fa"
  });
}
function offline() {
  Notify("网络状态已断开");
}
</script>

<style lang="less">
/**
	 * 图片大小为 600 px
	 */
.van-image-preview__image {
  width: 600px;
}
</style>